package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.bean.WaybillLisy

class CarViewDetailAdapter(mData: MutableList<WaybillLisy>) :
    BaseQuickAdapter<WaybillLisy, BaseViewHolder>(
        R.layout.item_car_view, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: WaybillLisy) {
        val text = holder.getView<TextView>(R.id.tv_text)
        text.text = "渠道单号: " + item.channelOrderNo + "\n" +
                "目的仓: " + item.receiveAddress + "\n" +
                "箱规: " + item.cartonNum + "箱     " +
                item.cartonNum + "m³     " +
                item.cartonNum + "kg" + "\n" +
                "运单状态: " + item.waybillStateStr + "    " +
                "验收状态: " + item.checkStateStr

        if (item.checkStateStr == "未验收") {
            text.setTextColor(Color.RED)
        } else {
            text.setTextColor(Color.BLUE)
        }
    }


}